<template>
    <div class="intro">
        <h3>{{intro.name}}</h3>
        <div class="nav-box">
            <div class="nav" :class="{active: activeIndex===0}" @click="changeIndex(0)">证书介绍</div>
            <div class="nav" :class="{active: activeIndex===1}" @click="changeIndex(1)">职业前景</div>
            <div class="nav" :class="{active: activeIndex===2}" @click="changeIndex(2)">报考指南</div>
            <div class="nav" :class="{active: activeIndex===3}" @click="gobuy()">证书获取</div>
        </div>
        <div class="pannel" @click="changeIndexAdd()" v-if="intro.id==='CPA'">
            <div class="pages">
                <i><i><i></i></i></i>
            </div>
            <div class="page" v-show="activeIndex===0">
                <img src="../../assets/image/sucai/u602.png"/>
                <img src="../../assets/image/sucai/u603.png"/>
            </div>
            <div class="page" v-show="activeIndex===1">
                <img src="../../assets/image/sucai/u609.png"/>
                <img src="../../assets/image/sucai/u610.png"/>
                <img src="../../assets/image/sucai/u611.png"/>
            </div>
            <div class="page" v-show="activeIndex===2">
                <img src="../../assets/image/sucai/u617.png"/>
                <img src="../../assets/image/sucai/u618.png"/>
            </div>
        </div>
        <div class="pannel" @click="changeIndexAdd()" v-if="intro.id==='CMA'">
            <div class="pages">
                <i><i><i></i></i></i>
            </div>
            <div class="page" v-show="activeIndex===0">
                <img src="../../assets/image/sucai/u526.jpg"/>
            </div>
            <div class="page" v-show="activeIndex===1">
                <img src="../../assets/image/sucai/u526.png"/>
            </div>
            <div class="page" v-show="activeIndex===2">
                <img src="../../assets/image/sucai/u540.jpg"/>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'labIntro',
    data() {
        return {
            introObject: {
                CPA: {
                    id: 'CPA',
                    name: 'CPA（注册管理会计师）',
                    page: 3
                },
                CMA: {
                    id: 'CMA',
                    name: 'CPA（注册管理会计师）',
                    page: 3
                }
            },
            intro: {},
            activeIndex: 0,
        };
    },
    mounted() {
        this.intro =this.introObject[this.$route.query.name]
    },
    methods: {
        changeIndex(index){
            this.activeIndex = index
        },
        changeIndexAdd() {
            if(this.activeIndex === 2) {
                this.activeIndex = 0;
            } else {
                this.activeIndex = this.activeIndex + 1
            }
        },
        gobuy() {
            this.$router.push({name:'courseCenter'})
        }
    }
};
</script>
<style lang="scss" scoped>
    .intro {
        position: relative;
        padding: 30px 0 40px;
        width: 100%;
        background: url("../../assets/image/back/u546.jpg") no-repeat, #8cb1ff;
        background-size: cover;
        background-position: top;
        h3{
            font-size: 48px;
            color: #fff;
            text-align: center;
        }
        .nav-box {
            display: flex;
            width: 1300px;
            margin: 0 auto;
            padding: 50px 0 30px;
            align-items: center;
            justify-content: space-between;
            .nav {
                width: 150px;
                height: 30px;
                line-height: 30px;
                text-align: center;
                border-radius: 15px;
                color: #fff;
                border: 1px solid #fff;
                cursor: pointer;
                &.active {
                    background: #fff;
                    color: #007aff;
                }
            }
        }
        .pannel {
            width: 1300px;
            margin: 0 auto;
            padding: 0 0 60px;
            .pages {
                position: relative;
                height: 90px;
                transform: rotate(180deg);
                i {
                    display: block;
                    margin: 0 30px;
                    padding-bottom: 30px;
                }
                >i {
                    position: relative;
                    height: 30px;
                    background: rgba(255,255,255,0.75);
                    >i {
                        height: 60px;
                        background: rgba(255,255,255,0.5);
                        >i{
                            height: 90px;
                            background: rgba(255,255,255,0.25);
                        }
                    }
                }
            }
            .page {
                display: flex;
                align-items: center;
                justify-content: space-between;
                background: #fff;
            }
        }
    }
</style>
